<template>
	<view class="searchle">
		<u-navbar
			title="讲师查询"
			:back-icon-size="28"
			back-icon-color="#000000"
			:title-size="28"
			:border-bottom="false"
			:back-text-style="{ color: '#000000', fontSize: '26rpx' }"
			title-color="#000000"
			:custom-back="goback"
			:background="{ background: '#ffffff' }"
		></u-navbar>
		<view class="main">
			<view class="main_top">
				<u-image width="70" height="70" src="https://letuilm.com/school/baike_files/logo_t.png"></u-image>
				<text class="top_text">乐推学院</text>
			</view>
			<view class="main_bot">
				<u-input v-model="search" type="text" :border="true" :height="60" placeholder="输入想要查询的讲师" />
				<u-button
					size="default"
					:ripple="true"
					:hair-line="false"
					:disabled="disabled"
					:custom-style="{
						height: '60rpx',
						color: disabled == true ? '#292930' : '#ffffff',
						backgroundColor: disabled == true ? '#DFDFDF' : '#FFDB28',
						border: 'none',
						marginTop: '56rpx'
					}"
					@click="dosearch"
				>
					查 询
				</u-button>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'haha',
	data() {
		return {
			disabled: true,
			search: ''
		};
	},
	//实例创建完成后被立即调用
	created() {},
	onLoad(option) {},
	watch: {
		search: function(val) {
			// console.log(this.form.username);
			if (val !== '') {
				this.disabled = false;
			} else {
				this.disabled = true;
			}
		}
	},
	//挂载开始之前被调用
	beforeMount() {},
	//  onPullDownRefresh() {
	//  //监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
	// console.log('refresh');
	// setTimeout(function() {
	// 	uni.stopPullDownRefresh(); //停止下拉刷新动画
	// }, 1000);
	//  },
	//初次渲染完成
	onReady() {},
	//全局只触发一次
	onLaunch() {},
	//从后台进入前台
	onShow() {},
	//前台进入后台
	onHide() {},
	methods: {
		dosearch(){
			console.log(this.search)
			uni.navigateTo({
				url:"/pages/college/leturse/searchend",
				animationType: 'pop-in',
				animationDuration: 200
			})
		},
		goback() {
			uni.navigateBack({
				delta: 1,
				animationType: 'pop-out',
				animationDuration: 200
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.searchle {
	.main {
		margin-top: 192rpx;
		.main_top {
			width: 400rpx;
			margin: 0 auto;
			display: flex;
			justify-content: space-around;
			align-items: center;
			margin-bottom: 212rpx;
			.top_text {
				// padding-left: 60rpx;
				font-size: 40rpx;
				color: #292930;
			}
		}
		.main_bot {
			width: 400rpx;
			margin: 0 auto;
		}
	}
}
</style>
